//
//  Y2Localization.h
//  Pods-Unity-iPhone
//
//  Created by MacPro on 2021/1/14.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    Y2LanguageEn,
    Y2LanguageZhHans,
    Y2LanguageZhHant,
    Y2LanguageUnknown = -1,
} Y2Language;

extern NSString *const Y2LanguageCodeEn;
extern NSString *const Y2LanguageCodeZhHans;
extern NSString *const Y2LanguageCodeZhHant;
extern NSString *const Y2LanguageCodeUnknown;

@interface Y2Localization : NSObject
// 当前使用语言
@property(nonatomic, assign)Y2Language currentLanguage;

+ (instancetype)shared;

// 本地语言
+ (Y2Language)localizedLanguage;

// 语言转Code
// e.g, 'en', 'zh-Hans' ...
+ (NSString *)languageCode:(Y2Language)language;
@end


@interface NSString (Y2Localized)
+ (instancetype)Y2Localized:(NSString *)localizable bundle:(NSBundle *)bundle table:(NSString *)tableName;
@end

NS_ASSUME_NONNULL_END
